import {DEVELOP_PREFIX, SYSTEM_PREFIX} from "@/store/constant";

export const tableOption = {
  height: 'auto',
  calcHeight: 210,
  searchShow: true,
  searchMenuSpan: 6,
  tip: false,
  border: true,
  index: true,
  selection: true,
  labelWidth: 120,
  viewBtn: true,
  column: [
    {
      label: "数据源",
      prop: "datasourceId",
      search: true,
      span: 24,
      type: "select",
      dicUrl: DEVELOP_PREFIX + "/datasource/select",
      props: {
        label: "name",
        value: "id"
      },
      rules: [{
        required: true,
        message: "请选择数据源",
        trigger: "blur"
      }]
    },
    {
      label: "模块名",
      prop: "codeName",
      search: true,
      rules: [{
        required: true,
        message: "请输入模块名",
        trigger: "blur"
      }]
    },
    {
      label: "服务名",
      prop: "serviceName",
      search: true,
      rules: [{
        required: true,
        message: "请输入服务名",
        trigger: "blur"
      }]
    },
    {
      label: "表名",
      prop: "tableName",
      rules: [{
        required: true,
        message: "请输入表名",
        trigger: "blur"
      }]
    },
    {
      label: "表前缀",
      prop: "tablePrefix",
      hide: true,
      rules: [{
        required: true,
        message: "请输入表前缀",
        trigger: "blur"
      }]
    },
    {
      label: "主键名",
      prop: "pkName",
      hide: true,
      rules: [{
        required: true,
        message: "请输入主键名",
        trigger: "blur"
      }]
    },
    {
      label: "包名",
      prop: "packageName",
      overHidden: true,
      rules: [{
        required: true,
        message: "请输入包名",
        trigger: "blur"
      }]
    },
    {
      label: "基础业务",
      prop: "baseMode",
      type: 'radio',
      dicUrl: SYSTEM_PREFIX + "/dict/dictionary?code=yes_no",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      hide: true,
      rules: [{
        required: true,
        message: "请选择基础业务",
        trigger: "blur"
      }]
    },
    {
      label: "包装器",
      prop: "wrapMode",
      type: 'radio',
      dicUrl: SYSTEM_PREFIX + "/dict/dictionary?code=yes_no",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
      hide: true,
      rules: [{
        required: true,
        message: "请选择包装器",
        trigger: "blur"
      }]
    },
    {
      label: "后端生成路径",
      prop: "apiPath",
      span: 24,
      hide: true,
      rules: [{
        required: true,
        message: "请输入后端生成路径",
        trigger: "blur"
      }]
    },
    {
      label: "前端生成路径",
      prop: "webPath",
      span: 24,
      hide: true,
      rules: [{
        required: true,
        message: "请输入前端生成路径",
        trigger: "blur"
      }]
    }
  ]
}
